var pageParamStr = $.url().param('pageParam');
var pageParam = JSON.parse(pageParamStr);
var globalElderName = pageParam.elderName;

if(getLoginedUser()) {
	$('#feesCreater').text(getLoginedUser().staffName);
}

$('#feesCreateTime').text('(于'+pageParam.createTime+'录入)');

var view = {
	data: pageParam
};

var vue_vm = new Vue({
	el: '#vue_vm',
	data: view,
	methods: {
		printPledge:function(data) {
			return printPledge(data);
		},
		printPrePay:function(data) {
			return printPrePay(data);
		}
	}
});

function printPledge(data) {
	var pageParam01 = data;
	
	pageParam01.payType = '押金';
	pageParam01.pay = pageParam01.pledgePay;
	pageParam01.elderName = globalElderName;
	pageParam01.paperType = 2;
	pageParam01.relationId = pageParam01.elderBeHospitalId + '-beHospitalPlede';
    pageParam01.beHospitalId = pageParam01.elderBeHospitalId;
	window.open('0_print_jf.html?pageParam='+encodeURIComponent(JSON.stringify(pageParam01)));
}

function printPrePay(data) {
	var pageParam01 = data;
	
	pageParam01.payType = '预交款';
	pageParam01.pay = pageParam01.totalPay - pageParam01.pledgePay;
	pageParam01.elderName = globalElderName;
	pageParam01.paperType = 2;
	pageParam01.relationId = pageParam01.elderBeHospitalId + '-prePay';
    pageParam01.beHospitalId = pageParam01.elderBeHospitalId;
	window.open('0_print_jf.html?pageParam='+encodeURIComponent(JSON.stringify(pageParam01)));
}